home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / etc / init.d / ubiquity < prev    next >
Text File  |  2008-10-29  |  2KB  |  101 lines

  1. #! /bin/sh
  2.  
  3. set -e
  4.  
  5. PATH=/sbin:/bin:/usr/sbin:/usr/bin
  6. NAME=ubiquity
  7.  
  8. test -x /usr/bin/ubiquity-dm || exit 0
  9.  
  10. ubiquity=
  11. automatic=
  12. debug=
  13. noninteractive=
  14. for x in $(cat /proc/cmdline); do
  15.     case $x in
  16.         debug-ubiquity)
  17.             debug="-d"
  18.             ubiquity=1
  19.             ;;
  20.         automatic-ubiquity)
  21.             automatic="--automatic"
  22.             ubiquity=1
  23.             ;;
  24.         only-ubiquity)
  25.             ubiquity=1
  26.             ;;
  27.         noninteractive)
  28.             ubiquity=1
  29.             noninteractive=1
  30.             ;;
  31.     esac
  32. done
  33. if [ -z "$ubiquity" ] && [ "$1" != force-start ]; then
  34.     exit 0
  35. fi
  36.     
  37. if [ -r /etc/environment ]; then
  38.     if LANG=$(pam_getenv -l LANG); then
  39.         export LANG
  40.     fi
  41.     if LANGUAGE=$(pam_getenv -l LANGUAGE); then
  42.         export LANGUAGE
  43.     fi
  44. fi
  45.  
  46. . /lib/lsb/init-functions
  47.  
  48. case "$1" in
  49.     start|force-start)
  50.         log_begin_msg "Starting Ubiquity..."
  51.         # if usplash is running, make sure to stop it now, yes "start" kills it.
  52.         if pidof usplash > /dev/null; then
  53.             usplash=:
  54.             orig_console="$(fgconsole)"
  55.             DO_NOT_SWITCH_VT=yes /etc/init.d/usplash start
  56.             # We've just shut down usplash, so don't log
  57.             # success as it will look weird on the console.
  58.             log_end_msg=:
  59.         else
  60.             usplash=false
  61.             log_end_msg=log_end_msg
  62.         fi
  63.         # turn off console blanking for install process
  64.         setterm -blank 0
  65.         if [ -n "$noninteractive" ]; then
  66.             cmd="ubiquity noninteractive"
  67.         else
  68.             # Run in the foreground.
  69.             cmd="ubiquity-dm vt7 :0 /usr/bin/ubiquity $debug $automatic --only"
  70.         fi
  71.         if ${cmd}; then
  72.             $log_end_msg 0
  73.         else
  74.             log_end_msg $?
  75.         fi
  76.  
  77.         if $usplash && [ "$orig_console" != serial ]; then
  78.             # Wait a short while for the active console to
  79.             # change, to try to avoid visible console noise from
  80.             # later init scripts.
  81.             i=0
  82.             while [ "$(fgconsole)" = "$orig_console" ]; do
  83.                 i="$(($i + 1))"
  84.                 if [ "$i" -gt 5 ]; then
  85.                     break
  86.                 fi
  87.                 sleep 1
  88.             done
  89.         fi
  90.     ;;
  91.     stop|restart|force-reload)
  92.     ;;
  93.     *)
  94.         N=/etc/init.d/$NAME
  95.         echo "Usage: $N {start|force-start|stop|restart|force-reload}" >&2
  96.         exit 1
  97.     ;;
  98. esac
  99.  
  100. exit 0
  101.